package com.chainyoung.trademarket.base;

import android.app.Application;
import android.content.Context;

import com.chainyoung.common.appcommon.db.DbDefaultConfiguration;
import com.chainyoung.common.base.CommonApplicationLike;
import com.chainyoung.common.constant.LibConstant;
import com.chainyoung.common.di.module.GlobeConfigModule;
import com.chainyoung.common.integration.ConfigModule;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.trademarket.BuildConfig;
import com.chainyoung.trademarket.R;
import com.chainyoung.trademarket.api.MainService;


import java.util.List;

/**
 * Author by Damon,  on 2018/7/26.
 */
public class AppConfig implements ConfigModule{

    @Override
    public void applyOptions(Context context, GlobeConfigModule.Builder builder) {
        builder.baseurl(LibConstant.BASE_URL);
               // .statusBarColor(R.color.colorPrimary)
               // .statusBarAlpha(255);
        if (BuildConfig.APP_DEBUG) {
            //builder.addInterceptor(new HttpLoggingInterceptor().setLevel(Level.BODY));
        }
    }

    @Override
    public void registerComponents(Context context, IRepositoryManager repositoryManager) {
        repositoryManager.injectRetrofitService(MainService.class);
        repositoryManager.injectRealmConfigs(DbDefaultConfiguration.getInstance());
    }

    @Override
    public void injectAppLifecycle(Context context, List<CommonApplicationLike.Lifecycle> lifecycles) {

    }

    @Override
    public void injectActivityLifecycle(Context context,
                                        List<Application.ActivityLifecycleCallbacks> lifecycles) {
    }


}
